473,420 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

Change background image of asp:button

I know I can use <a></aand modify it's :hover and :visited appearance
in my .css file. I'd like to know if I can do the same for a asp:button
control.

I'd like to do some processing of data in the on click event for the
asp:button control and I would like to be able to control it's
"visited" and "hover" appearance.

Using a hyperlink I would just write this in the .css file

a:hover
{
blah blah;}

a:visited
{
blah blah;}

Can I do the same for an asp:button? If so how?

I've tried using the asp:hyperlink but it does not have an on click
event in the code behind page.

I'm somewhat new to web programming so if there is a better approach to
this issue please let me know.

Thanks,
Iz

Jan 8 '07 #1
4 22076
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
Can I do the same for an asp:button? If so how?

I've tried using the asp:hyperlink but it does not have an on click
event in the code behind page.
Sounds like you need a combination of a button and a hyperlink - luckily,
Microsoft have provided one for you:
http://msdn2.microsoft.com/en-us/lib...inkbutton.aspx
Jan 8 '07 #2
Thanks Mark that looks like the control I'm looking for.

Will I still use

a:hover
{
background-image: url("somepath");}

....in order to change the background image when the user hovers over
the link?

Iz

Mark Rae wrote:
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
Can I do the same for an asp:button? If so how?

I've tried using the asp:hyperlink but it does not have an on click
event in the code behind page.

Sounds like you need a combination of a button and a hyperlink - luckily,
Microsoft have provided one for you:
http://msdn2.microsoft.com/en-us/lib...inkbutton.aspx
Jan 8 '07 #3
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Will I still use

a:hover
{
background-image: url("somepath");}

...in order to change the background image when the user hovers over
the link?
Well, have you tried it...? ;-)
Jan 8 '07 #4
I guess I should have before I asked.....it works great!

Thanks Mark,
Iz

Mark Rae wrote:
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Will I still use

a:hover
{
background-image: url("somepath");}

...in order to change the background image when the user hovers over
the link?

Well, have you tried it...? ;-)
Jan 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Russell | last post by:
I have a web page that i am using an image button as my submit button. The code behind the button works, but when I click enter on the web page, nothing happens. Can anybody tell me how to get my...
1
by: Miguel Dias Moura | last post by:
Hello, On na ASP.NET/VB web page i have a form and i have this button: <asp:Button ID="search" runat="server" OnClick="searchGO" Text="search" /> I want to use the image search.gif instead of...
4
by: rkbnair | last post by:
Is there any way to display an image button instead of the traditional Edit/Update/Cancel push button in a datagrid (with bound data)?
2
by: pmud | last post by:
Hi, I am designing a simple ASP.NET web page. I have an image button. What I want to do is: when the cursor is over the image button, a drop down meny should display. This menu should have tabs...
0
by: R.A.M. | last post by:
Hi, I need your help with login implementation in my ASP.NET 2.0 demo application. I have custom login control on my default.aspx page: .... <form id="LoginForm" runat="server" method="post"...
1
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
0
by: Italian Pete | last post by:
Hi, I have a c# asp.net web form which contains a User Control search bar composed of a text box and a search button (asp:ImageButton) In classic asp, I would have had the search bar as a...
3
by: glbdev | last post by:
Hi. I have a gridview in which each row has an image button attached. I have each button in each row set up to be associated with a DB field. When I hover above the button it shows me the...
4
by: glbdev | last post by:
Hi, I posted this question yesterday but didn't get the answer I needed. I am DESPERATE to get this working so I'm re-posting it because I don't think I worded it correctly. I have a GridView...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.